3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
To instantiate an object of a class, the QuickDraw 3D object system calls Q3XObjectHierarchy_NewObject .
The Q3XObjectHierarchy_NewObject routine instantiates an object in a class.
TQ3XObject Q3XObjectHierarchy_NewObject(
TQX3ObjectClass objectClass,
void *parameters);
The Q3XObjectHierarchy_NewObject routine begins the QuickDraw 3D object creation mechanism. The parameters pointed to by parameters are passed into the TQ3ObjectNewMethod method at each level.
To initialize multiple levels of data, organize the data structure into multiple levels as illustrated below:
typedef struct TFooGroupData {
float dummy1;
} TFooGroupData;
typedef struct TBarGroupData {
TFooGroupData fooData;
float dummy2;
} TBarGroupData;
This way, the new method for the fooGroup class receives a TFooGroupData parameter and subclassses receive initialization parameters.
Previous | QD3D Book | Overview | Chapter Contents | Next |